import request from '@/config/axios'

// 钱包提现 VO
export interface WalletWithdrawVO {
  id: number // 编号
  userId: number // 用户编号
  price: number // 提现金额
  feePrice: number // 提现手续费
  totalPrice: number // 当前总佣金
  type: number // 提现类型：1-钱包；2-银行卡；3-微信；4-支付宝
  name: string // 真实姓名
  accountNo: string // 账号
  bankName: string // 银行名称
  bankAddress: string // 开户地址
  accountQrCodeUrl: string // 收款码
  status: number // 状态：0-审核中，10-审核通过 20-审核不通过；预留：11 - 提现成功；21-提现失败
  auditReason: string // 审核驳回原因
  auditTime: Date // 审核时间
  remark: string // 备注
}

// 查询佣金提现列表
export const getWalletWithdrawPage = async (params: any) => {
  return await request.get({ url: `/member/wallet-withdraw/page`, params })
}

// 查询佣金提现详情
export const getWalletWithdraw = async (id: number) => {
  return await request.get({ url: `/member/wallet-withdraw/get?id=` + id })
}

// 佣金提现 - 通过申请
export const approveWalletWithdraw = async (id: number) => {
  return await request.put({ url: `/member/wallet-withdraw/approve?id=` + id })
}

// 审核佣金提现 - 驳回申请
export const rejectWalletWithdraw = async (data: WalletWithdrawVO) => {
  return await request.put({ url: `/member/wallet-withdraw/reject`, data })
}
